package com.yanze.mvvmlearndemo.moudles.req;

import android.databinding.BindingAdapter;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.yanze.mvvmlearndemo.R;

/**
 * Created by MrZheng on 2018/3/12.
 */

public class UserEntity {
    private String username;
    private String nickname;
    private String sex;
    private String userIcon;

    public UserEntity(String username, String nickname, String sex, String userIcon) {
        this.username = username;
        this.nickname = nickname;
        this.sex = sex;
        this.userIcon = userIcon;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getAge() {
        return sex;
    }

    public void setAge(String age) {
        this.sex = age;
    }

    public String getUserIcon() {
        return userIcon;
    }

    public void setUserIcon(String userIcon) {
        this.userIcon = userIcon;
    }

    @BindingAdapter("userIcon")
    public static void getInternetImage(ImageView imageView, String imgUrl) {
        Glide.with(imageView.getContext()).load(imgUrl).placeholder(R.drawable.placeholder_img).into(imageView);
    }
}
